home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / mailman < prev    next >
Encoding:
Text File  |  2010-11-16  |  10.7 KB  |  588 lines

  1. # mailman completion
  2.  
  3. have list_lists && {
  4. _mailman_lists()
  5. {
  6.     COMPREPLY=( $( compgen -W '$( list_lists -b )' -- "$cur" ) )
  7. }
  8.  
  9. _list_lists()
  10. {
  11.     local cur
  12.  
  13.     COMPREPLY=()
  14.     _get_comp_words_by_ref cur
  15.  
  16.     if [[ "$cur" == -* ]]; then
  17.         COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \
  18.             --bare --help' -- "$cur" ) )
  19.     fi
  20.  
  21. } &&
  22. complete -F _list_lists list_lists
  23. }
  24.  
  25. have add_members &&
  26. _add_members()
  27. {
  28.     local cur prev split=false
  29.  
  30.     COMPREPLY=()
  31.     _get_comp_words_by_ref cur prev
  32.  
  33.     _split_longopt && split=true
  34.  
  35.     case $prev in
  36.         -r|-d|--regular-members-file|--digest-members-file)
  37.             _filedir
  38.             return 0
  39.             ;;
  40.         -w|-a|--welcome-msg|--admin-notify)
  41.             COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
  42.             return 0
  43.             ;;
  44.     esac
  45.  
  46.     $split && return 0
  47.  
  48.     if [[ "$cur" == -* ]]; then
  49.         COMPREPLY=( $( compgen -W '--regular-members-file \
  50.             --digest-members-file --welcome-msg \
  51.             --admin-notify --help' -- "$cur" ) )
  52.     else
  53.         _mailman_lists
  54.     fi
  55.  
  56. } &&
  57. complete -F _add_members add_members
  58.  
  59. have remove_members &&
  60. _remove_members()
  61. {
  62.     local cur prev split=false
  63.  
  64.     COMPREPLY=()
  65.     _get_comp_words_by_ref cur prev
  66.  
  67.     _split_longopt && split=true
  68.  
  69.     case $prev in
  70.         -f|--file)
  71.             _filedir
  72.             return 0
  73.             ;;
  74.     esac
  75.  
  76.     $split && return 0
  77.  
  78.     if [[ "$cur" == -* ]]; then
  79.         COMPREPLY=( $( compgen -W '--file --all --fromall --nouserack \
  80.             --noadminack --help' -- "$cur" ) )
  81.     else
  82.         _mailman_lists
  83.     fi
  84.  
  85. } &&
  86. complete -F _remove_members remove_members
  87.  
  88. have find_member &&
  89. _find_member()
  90. {
  91.     local cur prev split=false
  92.  
  93.     COMPREPLY=()
  94.     _get_comp_words_by_ref cur prev
  95.  
  96.     _split_longopt && split=true
  97.  
  98.     case $prev in
  99.         -l|-x|--listname|--exclude)
  100.             _mailman_lists
  101.             return 0
  102.             ;;
  103.     esac
  104.  
  105.     $split && return 0
  106.  
  107.     if [[ "$cur" == -* ]]; then
  108.         COMPREPLY=( $( compgen -W '--listname --exclude --owners \
  109.             --help' -- "$cur" ) )
  110.     fi
  111.  
  112. } &&
  113. complete -F _find_member find_member
  114.  
  115. have clone_member &&
  116. _clone_member()
  117. {
  118.     local cur prev split=false
  119.  
  120.     COMPREPLY=()
  121.     _get_comp_words_by_ref cur prev
  122.  
  123.     _split_longopt && split=true
  124.  
  125.     case $prev in
  126.         -l|--listname)
  127.             _mailman_lists
  128.             return 0
  129.             ;;
  130.     esac
  131.  
  132.     $split && return 0
  133.  
  134.     if [[ "$cur" == -* ]]; then
  135.         COMPREPLY=( $( compgen -W '--listname --remove --admin \
  136.             --quiet --nomodify --help' -- "$cur" ) )
  137.     fi
  138.  
  139. } &&
  140. complete -F _clone_member clone_member
  141.  
  142. have sync_members &&
  143. _sync_members()
  144. {
  145.     local cur prev split=false
  146.  
  147.     COMPREPLY=()
  148.     _get_comp_words_by_ref cur prev
  149.  
  150.     _split_longopt && split=true
  151.  
  152.     case $prev in
  153.         -w|-g|-d|--welcome-msg|--goodbye-msg|--digest)
  154.             COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
  155.             return 0
  156.             ;;
  157.         -d|--file)
  158.             _filedir
  159.             return 0
  160.             ;;
  161.     esac
  162.  
  163.     $split && return 0
  164.  
  165.     if [[ "$cur" == -* ]]; then
  166.         COMPREPLY=( $( compgen -W '--no-change --welcome-msg \
  167.             --goodbye-msg --digest --notifyadmin --file --help' -- "$cur" ) )
  168.     else
  169.         _mailman_lists
  170.     fi
  171.  
  172. } &&
  173. complete -F _sync_members sync_members
  174.  
  175. have unshunt &&
  176. _unshunt()
  177. {
  178.     local cur
  179.  
  180.     COMPREPLY=()
  181.     _get_comp_words_by_ref cur
  182.  
  183.     if [[ "$cur" == -* ]]; then
  184.         COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
  185.     else
  186.         _filedir -d
  187.     fi
  188.  
  189. } &&
  190. complete -F _unshunt unshunt
  191.  
  192. have list_admins &&
  193. _list_admins()
  194. {
  195.     local cur
  196.  
  197.     COMPREPLY=()
  198.     _get_comp_words_by_ref cur
  199.  
  200.     if [[ "$cur" == -* ]]; then
  201.         COMPREPLY=( $( compgen -W '--all-vhost --all --help' -- "$cur" ) )
  202.     else
  203.         _mailman_lists
  204.     fi
  205.  
  206. } &&
  207. complete -F _list_admins list_admins
  208.  
  209. have list_owners &&
  210. _list_owners()
  211. {
  212.     local cur
  213.  
  214.     COMPREPLY=()
  215.     _get_comp_words_by_ref cur
  216.  
  217.     if [[ "$cur" == -* ]]; then
  218.         COMPREPLY=( $( compgen -W '--with-listnames --moderators \
  219.             --help' -- "$cur" ) )
  220.     else
  221.         _mailman_lists
  222.     fi
  223.  
  224. } &&
  225. complete -F _list_owners list_owners
  226.  
  227. have list_members &&
  228. _list_members()
  229. {
  230.     local cur prev split=false
  231.  
  232.     COMPREPLY=()
  233.     _get_comp_words_by_ref cur prev
  234.  
  235.     _split_longopt && split=true
  236.  
  237.     case $prev in
  238.         -o|--output)
  239.             _filedir
  240.             return 0
  241.             ;;
  242.         -d|--digest)
  243.             COMPREPLY=( $( compgen -W 'mime plain' -- "$cur") )
  244.             return 0
  245.             ;;
  246.         -n|--nomail)
  247.             COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \
  248.                 -- "$cur") )
  249.             return 0
  250.             ;;
  251.     esac
  252.  
  253.     $split && return 0
  254.  
  255.     if [[ "$cur" == -* ]]; then
  256.         COMPREPLY=( $( compgen -W '--output --regular --digest \
  257.             --nomail --fullnames --preserve --help' -- "$cur" ) )
  258.     else
  259.         _mailman_lists
  260.     fi
  261.  
  262. } &&
  263. complete -F _list_members list_members
  264.  
  265. have change_pw &&
  266. _change_pw()
  267. {
  268.     local cur prev split=false
  269.  
  270.     COMPREPLY=()
  271.     _get_comp_words_by_ref cur prev
  272.  
  273.     _split_longopt && split=true
  274.  
  275.     case $prev in
  276.         -l|--listname)
  277.             _mailman_lists
  278.             return 0
  279.             ;;
  280.     esac
  281.  
  282.     $split && return 0
  283.  
  284.     if [[ "$cur" == -* ]]; then
  285.         COMPREPLY=( $( compgen -W '--all --domain --listname \
  286.             --password --quiet --help' -- "$cur" ) )
  287.     fi
  288.  
  289. } &&
  290. complete -F _change_pw change_pw
  291.  
  292. have withlist &&
  293. _withlist()
  294. {
  295.     local cur
  296.  
  297.     COMPREPLY=()
  298.     _get_comp_words_by_ref cur
  299.  
  300.     if [[ "$cur" == -* ]]; then
  301.         COMPREPLY=( $( compgen -W '--lock --interactive \
  302.             --run --all --quiet --help' -- "$cur" ) )
  303.     else
  304.         _mailman_lists
  305.     fi
  306.  
  307. } &&
  308. complete -F _withlist withlist
  309.  
  310. have newlist &&
  311. _newlist()
  312. {
  313.     local cur
  314.  
  315.     COMPREPLY=()
  316.     _get_comp_words_by_ref cur
  317.  
  318.     if [[ "$cur" == -* ]]; then
  319.         COMPREPLY=( $( compgen -W '--language --quiet --help' -- "$cur" ) )
  320.     else
  321.         _mailman_lists
  322.     fi
  323.  
  324. } &&
  325. complete -F _newlist newlist
  326.  
  327. have rmlist &&
  328. _rmlist()
  329. {
  330.     local cur
  331.  
  332.     COMPREPLY=()
  333.     _get_comp_words_by_ref cur
  334.  
  335.     if [[ "$cur" == -* ]]; then
  336.         COMPREPLY=( $( compgen -W '--archives --help' -- "$cur" ) )
  337.     else
  338.         _mailman_lists
  339.     fi
  340.  
  341. } &&
  342. complete -F _rmlist rmlist
  343.  
  344. have config_list &&
  345. _config_list()
  346. {
  347.     local cur prev split=false
  348.  
  349.     COMPREPLY=()
  350.     _get_comp_words_by_ref cur prev
  351.  
  352.     _split_longopt && split=true
  353.  
  354.     case $prev in
  355.         -i|-o|--inputfile|--outputfile)
  356.             _filedir
  357.             return 0
  358.             ;;
  359.     esac
  360.  
  361.     $split && return 0
  362.  
  363.     if [[ "$cur" == -* ]]; then
  364.         COMPREPLY=( $( compgen -W '--inputfile --outputfile \
  365.             --checkonly --verbose --help' -- "$cur" ) )
  366.     else
  367.         _mailman_lists
  368.     fi
  369.  
  370. } &&
  371. complete -F _config_list -o filenames config_list
  372.  
  373. # Try to detect whether this is the mailman "arch" to avoid installing
  374. # it for the coreutils/util-linux-ng one.
  375. have arch && have mailmanctl &&
  376. _arch()
  377. {
  378.     local cur prev split=false
  379.  
  380.     COMPREPLY=()
  381.     _get_comp_words_by_ref cur prev
  382.  
  383.     _split_longopt && split=true
  384.  
  385.     case $prev in
  386.         -w|-g|-d|--welcome-msg|--goodbye-msg|--digest)
  387.             COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
  388.             return 0
  389.             ;;
  390.         -d|--file)
  391.             _filedir
  392.             return 0
  393.             ;;
  394.     esac
  395.  
  396.     $split && return 0
  397.  
  398.     if [[ "$cur" == -* ]]; then
  399.         COMPREPLY=( $( compgen -W '--wipe --start --end --quiet \
  400.             --help' -- "$cur" ) )
  401.     else
  402.         args=$COMP_CWORD
  403.         for (( i=1; i < COMP_CWORD; i++ )); do
  404.             if [[ "${COMP_WORDS[i]}" == -* ]]; then
  405.                 args=$(($args-1))
  406.             fi
  407.         done
  408.         case $args in
  409.             1)
  410.                 _mailman_lists
  411.                 ;;
  412.             2)
  413.                 _filedir
  414.                 ;;
  415.         esac
  416.     fi
  417.  
  418. } &&
  419. complete -F _arch -o filenames arch
  420.  
  421. have cleanarch &&
  422. _cleanarch()
  423. {
  424.     local cur
  425.  
  426.     COMPREPLY=()
  427.     _get_comp_words_by_ref cur
  428.  
  429.     if [[ "$cur" == -* ]]; then
  430.         COMPREPLY=( $( compgen -W '--status --dry-run --quiet \
  431.             --help' -- "$cur" ) )
  432.     fi
  433.  
  434. } &&
  435. complete -F _cleanarch cleanarch
  436.  
  437. have inject &&
  438. _inject()
  439. {
  440.     local cur prev split=false
  441.  
  442.     COMPREPLY=()
  443.     _get_comp_words_by_ref cur prev
  444.  
  445.     _split_longopt && split=true
  446.  
  447.     case $prev in
  448.         -l|--listname)
  449.             _mailman_lists
  450.             return 0
  451.             ;;
  452.     esac
  453.  
  454.     $split && return 0
  455.  
  456.     if [[ "$cur" == -* ]]; then
  457.         COMPREPLY=( $( compgen -W '--listname --queue --help' -- "$cur" ) )
  458.     else
  459.         _filedir
  460.     fi
  461.  
  462. } &&
  463. complete -F _inject -o filenames inject
  464.  
  465. have dumpdb &&
  466. _dumpdb()
  467. {
  468.     local cur
  469.  
  470.     COMPREPLY=()
  471.     _get_comp_words_by_ref cur
  472.  
  473.     if [[ "$cur" == -* ]]; then
  474.         COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \
  475.             --help' -- "$cur" ) )
  476.     else
  477.         _filedir
  478.     fi
  479.  
  480. } &&
  481. complete -F _dumpdb -o filenames dumpdb
  482.  
  483. have check_db &&
  484. _check_db()
  485. {
  486.     local cur
  487.  
  488.     COMPREPLY=()
  489.     _get_comp_words_by_ref cur
  490.  
  491.     if [[ "$cur" == -* ]]; then
  492.         COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) )
  493.     else
  494.         _mailman_lists
  495.     fi
  496.  
  497. } &&
  498. complete -F _check_db check_db
  499.  
  500. have check_perms &&
  501. _check_perms()
  502. {
  503.     local cur
  504.  
  505.     COMPREPLY=()
  506.     _get_comp_words_by_ref cur
  507.  
  508.     if [[ "$cur" == -* ]]; then
  509.         COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) )
  510.     fi
  511.  
  512. } &&
  513. complete -F _check_perms check_perms
  514.  
  515. have genaliases &&
  516. _genaliases()
  517. {
  518.     local cur
  519.  
  520.     COMPREPLY=()
  521.     _get_comp_words_by_ref cur
  522.  
  523.     if [[ "$cur" == -* ]]; then
  524.         COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) )
  525.     fi
  526.  
  527. } &&
  528. complete -F _genaliases genaliases
  529.  
  530. have mmsitepass &&
  531. _mmsitepass()
  532. {
  533.     local cur
  534.  
  535.     COMPREPLY=()
  536.     _get_comp_words_by_ref cur
  537.  
  538.     if [[ "$cur" == -* ]]; then
  539.         COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) )
  540.     fi
  541.  
  542. } &&
  543. complete -F _mmsitepass mmsitepass
  544.  
  545. have qrunner &&
  546. _qrunner()
  547. {
  548.     local cur prev
  549.  
  550.     COMPREPLY=()
  551.     _get_comp_words_by_ref cur prev
  552.  
  553.     _split_longopt && return 0
  554.  
  555.     if [[ "$cur" == -* ]]; then
  556.         COMPREPLY=( $( compgen -W '--runner --once \
  557.             --list --verbose --subproc --help' -- "$cur" ) )
  558.     fi
  559.  
  560. } &&
  561. complete -F _qrunner qrunner
  562.  
  563. have mailmanctl &&
  564. _mailmanctl()
  565. {
  566.     local cur
  567.  
  568.     COMPREPLY=()
  569.     _get_comp_words_by_ref cur
  570.  
  571.     if [[ "$cur" == -* ]]; then
  572.         COMPREPLY=( $( compgen -W '--no-restart --run-as-user \
  573.             --stale-lock-cleanup --quiet --help' -- "$cur" ) )
  574.     else
  575.         COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) )
  576.     fi
  577.  
  578. } &&
  579. complete -F _mailmanctl mailmanctl
  580.  
  581. # Local variables:
  582. # mode: shell-script
  583. # sh-basic-offset: 4
  584. # sh-indent-comment: t
  585. # indent-tabs-mode: nil
  586. # End:
  587. # ex: ts=4 sw=4 et filetype=sh
  588.